<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>公众号自定义菜单</title>
<%@include file="../collect/meta.jsp"%>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/table.css" type="text/css"></link>
<link rel="stylesheet" href="css/weixinmenu_manager.css" type="text/css"></link>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li>n微信管理</li>
							<li>菜单管理</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="alert alert-success">
									为什么自定义菜单创建成功了，在微信客户端的公众账号上却不显示？<br>
									由于微信客户端缓存的原因，自定义菜单创建成功后，需要24小时以后才能显示出来。
									开发者在测试时，可以尝试取消关注公众账号后再次关注，这样能立即看到最新的菜单效果。<br>
									PS：菜单更新、菜单删除也会有缓存。
								</div>
								<form action="weixinmenu!addWeiXinMenu" name="addMenu"
									method="post">
									<input type="hidden" name="menuCount" value="${menuCount }">
									<table id="table_bug_report"
										class="table table-striped table-bordered table-hover">
										<c:if test="${not empty result }">
											<tr>
												<th colspan="5">
													<font>
															<c:choose>
																<c:when test="${result == 1 }">菜单已保存！</c:when>
																<c:when test="${result == 2 }">菜单创建成功！</c:when>
																<c:when test="${result == 3 }">主菜单1不能为空！</c:when>
																<c:otherwise>${result }</c:otherwise>
															</c:choose> 
												   </font>
											   </th>
											</tr>
										</c:if>
										<tr>
											<th>菜单序号</th>
											<th>菜单名称</th>
											<th>触发方式</th>
											<th>消息关键词</th>
											<th>跳转网页地址</th>
										</tr>
										<tr>
											<td><font>主菜单1</font> <input type="hidden"
												name="menus[0].button" value="true"> <input
												type="hidden" name="menus[0].subButton" value="false">
											</td>
											<td><input type="text" id="menu0"
												name="menus[0].name" value="${menus[0].name }">
											</td>
											<td><select name="menus[0].type"
												style="visibility: hidden;">
													<option value="click">发送消息</option>
													<option value="view">跳转到网页</option>
											</select></td>
											<td><select name="menus[0].key"
												style="visibility: hidden;">
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }">${reply.title }</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[0].url"
												style="visibility: hidden;">
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }">${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单1 <input type="hidden"
												name="menus[1].button" value="false"> <input
												type="hidden" name="menus[1].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[1].name" value="${menus[1].name }"></td>
											<td><select name="menus[1].type" class="distype">
													<option value="click"
														<c:if test="${menus[1].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[1].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[1].key" class="diskey"
												<c:if test="${menus[1].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[1].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[1].url" class="disurl"
												<c:if test="${menus[1].type == 'click' || menus[1].type == null}">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[1].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单2 <input type="hidden"
												name="menus[2].button" value="false"> <input
												type="hidden" name="menus[2].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[2].name" value="${menus[2].name }"></td>
											<td><select name="menus[2].type" class="distype">
													<option value="click"
														<c:if test="${menus[2].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[2].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[2].key" class="diskey"
												<c:if test="${menus[2].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[2].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[2].url" class="disurl"
												<c:if test="${menus[2].type == 'click' || menus[2].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[2].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单3 <input type="hidden"
												name="menus[3].button" value="false"> <input
												type="hidden" name="menus[3].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[3].name" value="${menus[3].name }"></td>
											<td><select name="menus[3].type" class="distype">
													<option value="click"
														<c:if test="${menus[3].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[3].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[3].key" class="diskey"
												<c:if test="${menus[3].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[3].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[3].url" class="disurl"
												<c:if test="${menus[3].type == 'click' || menus[3].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[3].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单4 <input type="hidden"
												name="menus[4].button" value="false"> <input
												type="hidden" name="menus[4].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[4].name" value="${menus[4].name }"></td>
											<td><select name="menus[4].type" class="distype">
													<option value="click"
														<c:if test="${menus[4].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[4].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[4].key" class="diskey"
												<c:if test="${menus[4].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[4].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[4].url" class="disurl"
												<c:if test="${menus[4].type == 'click' || menus[4].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[4].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单5 <input type="hidden"
												name="menus[5].button" value="false"> <input
												type="hidden" name="menus[5].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[5].name" value="${menus[5].name }"></td>
											<td><select name="menus[5].type" class="distype">
													<option value="click"
														<c:if test="${menus[5].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[5].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[5].key" class="diskey"
												<c:if test="${menus[5].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[5].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[5].url" class="disurl"
												<c:if test="${menus[5].type == 'click' || menus[5].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[5].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td><font color="red">主菜单2</font> <input type="hidden"
												name="menus[6].button" value="true"> <input
												type="hidden" name="menus[6].subButton" value="false">
											</td>
											<td><input type="text"
												name="menus[6].name" value="${menus[6].name }"></td>
											<td><select name="menus[6].type"
												style="visibility: hidden;">
													<option value="click">发送消息</option>
													<option value="view">跳转到网页</option>
											</select></td>
											<td><select name="menus[6].key"
												style="visibility: hidden;">
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }">${reply.title }</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[6].url"
												style="visibility: hidden;">
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }">${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单1 <input type="hidden"
												name="menus[7].button" value="false"> <input
												type="hidden" name="menus[7].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[7].name" value="${menus[7].name }"></td>
											<td><select name="menus[7].type" class="distype">
													<option value="click"
														<c:if test="${menus[7].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[7].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[7].key" class="diskey"
												<c:if test="${menus[7].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[7].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[7].url" class="disurl"
												<c:if test="${menus[7].type == 'click' || menus[7].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[7].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单2 <input type="hidden"
												name="menus[8].button" value="false"> <input
												type="hidden" name="menus[8].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[8].name" value="${menus[8].name }"></td>
											<td><select name="menus[8].type" class="distype">
													<option value="click"
														<c:if test="${menus[8].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[8].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[8].key" class="diskey"
												<c:if test="${menus[8].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[8].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[8].url" class="disurl"
												<c:if test="${menus[8].type == 'click' || menus[8].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[8].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单3 <input type="hidden"
												name="menus[9].button" value="false"> <input
												type="hidden" name="menus[9].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[9].name" value="${menus[9].name }"></td>
											<td><select name="menus[9].type" class="distype">
													<option value="click"
														<c:if test="${menus[9].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[9].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[9].key" class="diskey"
												<c:if test="${menus[9].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[9].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[9].url" class="disurl"
												<c:if test="${menus[9].type == 'click' || menus[9].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[9].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单4 <input type="hidden"
												name="menus[10].button" value="false"> <input
												type="hidden" name="menus[10].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[10].name" value="${menus[10].name }"></td>
											<td><select name="menus[10].type" class="distype">
													<option value="click"
														<c:if test="${menus[10].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[10].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[10].key" class="diskey"
												<c:if test="${menus[10].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[10].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[10].url" class="disurl"
												<c:if test="${menus[10].type == 'click' || menus[10].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[10].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单5 <input type="hidden"
												name="menus[11].button" value="false"> <input
												type="hidden" name="menus[11].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[11].name" value="${menus[11].name }"></td>
											<td><select name="menus[11].type" class="distype">
													<option value="click"
														<c:if test="${menus[11].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[11].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[11].key" class="diskey"
												<c:if test="${menus[11].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[11].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[11].url" class="disurl"
												<c:if test="${menus[11].type == 'click' || menus[11].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[11].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td><font color="red">主菜单3</font> <input type="hidden"
												name="menus[12].button" value="true"> <input
												type="hidden" name="menus[12].subButton" value="false">
											</td>
											<td><input type="text"
												name="menus[12].name" value="${menus[12].name }"></td>
											<td><select name="menus[12].type"
												style="visibility: hidden;">
													<option value="click">发送消息</option>
													<option value="view">跳转到网页</option>
											</select></td>
											<td><select name="menus[12].key"
												style="visibility: hidden;">
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }">${reply.title }</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[12].url"
												style="visibility: hidden;">
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }">${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单1 <input type="hidden"
												name="menus[13].button" value="false"> <input
												type="hidden" name="menus[13].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[13].name" value="${menus[13].name }"></td>
											<td><select name="menus[13].type" class="distype">
													<option value="click"
														<c:if test="${menus[13].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[13].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[13].key" class="diskey"
												<c:if test="${menus[13].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[13].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[13].url" class="disurl"
												<c:if test="${menus[13].type == 'click' || menus[13].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[13].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单2 <input type="hidden"
												name="menus[14].button" value="false"> <input
												type="hidden" name="menus[14].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[14].name" value="${menus[14].name }"></td>
											<td><select name="menus[14].type" class="distype">
													<option value="click"
														<c:if test="${menus[14].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[14].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[14].key" class="diskey"
												<c:if test="${menus[14].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[14].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[14].url" class="disurl"
												<c:if test="${menus[14].type == 'click' || menus[14].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[14].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单3 <input type="hidden"
												name="menus[15].button" value="false"> <input
												type="hidden" name="menus[15].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[15].name" value="${menus[15].name }"></td>
											<td><select name="menus[15].type" class="distype">
													<option value="click"
														<c:if test="${menus[15].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[15].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[15].key" class="diskey"
												<c:if test="${menus[15].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[15].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[15].url" class="disurl"
												<c:if test="${menus[15].type == 'click' || menus[15].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[15].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td align="center">子菜单4 <input type="hidden"
												name="menus[16].button" value="false"> <input
												type="hidden" name="menus[16].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[16].name" value="${menus[16].name }"></td>
											<td><select name="menus[16].type" class="distype">
													<option value="click"
														<c:if test="${menus[16].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[16].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[16].key" class="diskey"
												<c:if test="${menus[16].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[16].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[16].url" class="disurl"
												<c:if test="${menus[16].type == 'click' || menus[16].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[16].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
										<tr>
											<td>子菜单5 <input type="hidden"
												name="menus[17].button" value="false"> <input
												type="hidden" name="menus[17].subButton" value="true">
											</td>
											<td><input type="text"
												name="menus[17].name" value="${menus[17].name }"></td>
											<td><select name="menus[17].type" class="distype">
													<option value="click"
														<c:if test="${menus[17].type == 'click' }">selected='selected'</c:if>>发送消息</option>
													<option value="view"
														<c:if test="${menus[17].type == 'view' }">selected='selected'</c:if>>跳转到网页</option>
											</select></td>
											<td><select name="menus[17].key" class="diskey"
												<c:if test="${menus[17].type == 'view' }">style='display:none;'</c:if>>
													<c:forEach items="${replies }" var="reply">
														<option value="${reply.id }"
															<c:if test="${menus[17].key == reply.id }">selected='selected'</c:if>>${reply.title
															}</option>
													</c:forEach>
											</select></td>
											<td><select name="menus[17].url" class="disurl"
												<c:if test="${menus[17].type == 'click' || menus[17].type == null }">style='display:none;'</c:if>>
													<c:forEach items="${bWeixinurls }" var="bWeixinurl">
														<option value="${bWeixinurl.id }"
															<c:if test="${menus[17].weixinurl.id == bWeixinurl.id }">selected='selected'</c:if>>${bWeixinurl.name
															}</option>
													</c:forEach>
											</select></td>
										</tr>
									</table>
									<div class="btn-team">
										<button class="btn btn-primary radius" type="submit">保存</button>
										<span id="fabu"> <c:choose>
												<c:when test="${result == 3}">
													<button class="btn btn-primary radius" type="button"
														disabled="disabled">发布</button>
												</c:when>
												<c:otherwise>
													<a class="btn btn-primary radius"
														href="weixinmenu!publishWeiXinMenu">发布</a>
												</c:otherwise>
											</c:choose> 
										</span>
									</div>
									<div class="text">
										【保存】用于将您设置好的菜单信息保存起来。【发布】用于将您的菜单信息创建到您的微信公众号上。</div>
								</form>
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>
</body>
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						var menu0 = $("#menu0").val();
						if (menu0 == null || menu0 == '') {
							$("#fabu")
									.html(
											"<button class='btn btn-primary radius' type='button' disabled='disabled'>发布</button>");
						} else {
							$("#fabu")
									.html(
											"<a class='btn btn-primary radius' href='weixinmenu!publishWeiXinMenu'>发布</a>");
						}
						$(".distype").change(function() {
							var index = $(".distype").index(this);
							var distype = $(".distype")[index];
							var selkey = $(".diskey")[index];
							var selurl = $(".disurl")[index];
							if ($(distype).val() == "click") {
								$(selkey).show();
								$(selurl).hide();
							} else {
								$(selkey).hide();
								$(selurl).show();
							}
						});
					});

	//防dropmenu刷新收回$菜单管理
	$(document).ready(function() {
		$('.weixinguanli > ul').show();
		$('.weixinguanli > ul > li > a').eq(2).css("color", "red");
	});
</script>
</html>